<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
<spring:url value="/create_league" var="create_league_url" />
</head>

<body>

<h2>League List</h2>

<a href="${create_league_url}">Create League</a>

	<table>
  	<thead>
  		<tr>
  		<th>League ID</th>
  		<th>League Name</th>
  		</tr>
  	</thead>
  	<tbody>
		<c:forEach var="league" items="${leagues}">
			<tr>
	  		<td><c:out value="${league.id}"/></td>
	  		<td><a href="${league_url}${league.id}"><c:out value="${league.name}"/></a></td>
	  		</tr>
		</c:forEach>
	</tbody>
  	</table>

</body>
</html>

